package com.roc.util.constant;

import org.apache.commons.lang3.StringUtils;

/**
 * 
 * @author zhaofeng
 *
 */
public enum TerminalBrandTek {
	TEK_TUHAOJIN("S98TEK", "02"),//土豪金
	TEK_HUAZHIRONG("HZRTEK", "03"),//华智融
	TEK_BAIFU("BFTEK", "01"),//百富
	TEK_SHIDA("SDTEK", "04"),//实达
	TEK_LIANDI("LDTEK", "05"),//联迪
	TEK_NEWLAND("XDLTEK", "06"),//新大陆
	TEK_A6("YMSZTEK", "07"),//一鸣神州
	TEK_HXTEK("HXTEK", "08");//银点
	
	private String name;
	private String code;
	private TerminalBrandTek(String name, String code) {
		this.code = code;
		this.name = name;
	}
	public static TerminalBrandTek valueOfCode(String code) {
		if (StringUtils.isBlank(code)) {
			throw new IllegalArgumentException("SysLogType code " + code
					+ " is blank");
		}
		for (TerminalBrandTek ms : values()) {
			if (ms.getCode().equals(code)) {
				return ms;
			}
		}
		throw new IllegalArgumentException("SysLogType code " + code
				+ " is not exist");
	}
	
	 public static String getName(String code) {
         for (TerminalBrandTek c : TerminalBrandTek.values()) {
             if (c.getCode().equals(code)) {
                 return c.name;
             }
         }
         return null;
     }
	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

}
